package ru.passivemoney.subscribers;

import ru.passivemoney.strategy.AStrategy;
import ru.passivemoney.strategy.Prognosis;

import com.dukascopy.api.IBar;
import com.dukascopy.api.Instrument;
import com.dukascopy.api.JFException;
import com.dukascopy.api.Period;

/**
 * @see ru.passivemoney.subscribers.ASubscriber
 * @author artem
 *
 */
public class Subscriber extends ASubscriber {
	
	public Subscriber(Instrument instrument, AStrategy strategy) {
		super(instrument, strategy);
		
	}
	
	public void reactOnBar(Period period, IBar askBar, IBar bidBar) throws JFException{
		Prognosis prognosis = strategy.processBar(instrument, period, askBar, bidBar);
		/*
		if(prognosis.compareTo(Consts.MIN_PROGNOSIS) > 0){
			Job openOrderJob = null;
			if(prognosis.compareTo(BigDecimal.ZERO) > 0){
				openOrderJob = new JobOO(true, true, askPrice, bidPrice, instrument);// open bull order with stop loss
			}else{
				openOrderJob = new JobOO(false, true, askPrice, bidPrice, instrument);// open bear order with stop loss
			}
			JobsRunner.putJob(openOrderJob);
		}
		*/
	}
	
}
